#coding=utf-8
import mongo
import status

def handler(client,ip_str,data):
    print client,ip_str,data
    ret = [{"rep":data["req"],"status":status.SUCCESS},[],{},False]
    if not mongo.insert_user(data["name"],data["passwd"],ip_str):
        ret[0]["status"] = status.FAILED
    return ret